<?php
class Contact extends CWidget{
	
	public function run(){
		$lans=array('EN'=>array(
							'aboutus'=>'ABOUT US',
							'tel'=>'Tel',			
							'fax'=>'Fax',											
							'address'=>'Address',							
							'mail'=>'Email',

		),
				'ZH'=>array(
							'aboutus'=>'关于我们',
							'tel'=>'电话',			
							'fax'=>'传真',											
							'address'=>'地址',								
							'mail'=>'邮箱',
		),
		);
		$language = strtoupper( Yii::app()->session->offSetGet( "FrontLanguage" ) );
		$lan=$lans[$language];
		$array = array('QQ','SKYPE','MSN','SaleEmail','TEL','FAX','ZHAddress','ENAddress');
		foreach( $array as $value ){
			$datas[$value] = Config::model()->findByPk($value)->ConfigValue;
		}		
		$datas['address']=$datas[$language.'Address'];
		echo '
          <div class="title1">'.$lan['aboutus'].'</div>
          <div class="add">
		  	<div class="companyinfo">
				'.$lan['tel'].'：'.$datas['TEL'].'<br/>
				'.$lan['fax'].'：'.$datas['FAX'].'<br/>	<br/>
				'.$lan['address'].'：'.$datas['address'].'<br/>			
			</div>
          <div class="mail"><a href="mailto:'.$datas['SaleEmail'].'">'.$lan['mail'].'：'.$datas['SaleEmail'].'</a></div>
          <div class="livechat"> <div class="link"><a href="#"><img src="images/live chat.png" width="206" height="69" alt="livechat" /></a></div>
          <div class="online"><span><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin='.$datas['QQ'].'&site=qq&menu=yes"><img src="images/qq.png" border="0" /></a></span><span><a href="msnim:add?contact='.$datas['MSN'].'"><img src="images/msn.png" border="0" /></a></span><span><a href="skype:'.$datas['SKYPE'].'?call"><img src="images/skype.png"  border="0" /></a></span><p></div>
          </div>
          </div>';
	}
}